package main

import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"go-monitor/common/crypto"
	"go-monitor/common/model"
	"go-monitor/common/utility"
)

func main() {
	fmt.Println(getSign())
}

// 获取签名
func getSign() string {
	req := model.CommonSign{}
	req.Diytime = utility.GetDiyFormatNowHour()
	req.Sign = ""
	b, _ := json.Marshal(req)
	aa, _ := crypto.RsaEncrypt([]byte(utility.GetMd5String(string(b))), model.HTTPSeverPublicKey)
	sign := base64.StdEncoding.EncodeToString(aa)
	return sign
}
